import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  }, 
   {
    path: '/Pledge',
    name: 'Pledge',
    component: () => import('@/views/Pledge.vue')
   },
   {
    path: '/myCommunity',
    name: 'myCommunity',
    component: () => import('@/views/myCommunity.vue')
   },   
   {
    path: '/National',
    name: 'National',
    component: () => import('@/views/National.vue')
   },
   {
    path: '/Bond',
    name: 'Bond',
    component: () => import('@/views/Bond.vue')
   },
   {
    path: '/myCommunity',
    name: 'myCommunity',
    component: () => import('@/views/myCommunity.vue')
   },
   {
    path: '/news',
    name: 'news',
    component: () => import('@/views/news.vue')
   },
   {
    path: '/Turbine',
    name: 'Turbine',
    component: () => import('@/views/Turbine.vue')
   },
   {
    path: '/statistics',
    name: 'statistics',
    component: () => import('@/views/statistics.vue')
   },
   
   


   
  

]

const router = new VueRouter({
  routes,
  scrollBehavior(to, from, savedPosition) {
    //设置回到顶部
    if (savedPosition) {
      return savedPosition;
    }
    return { x: 0, y: 0 };
  },
});

export default router
